package controller.interfaces;

import java.util.List;

import model.IEntity;
import model.Kunde;

public interface IDatabaseController extends IRechnung
{
	public void saveEntity(IEntity entity);
	
	/**
	 * Gets a list of all Entities from the DB
	 * I know - its a stupid design, but it works - just pass "new Zimmer()" to this method.. and it gets a list of all Zimmers
	 * @param e "new WantedEntity()"
	 * @return
	 * @deprecated
	 */
	public <T extends IEntity> List<T> loadAllEntities(T e);  
	
	/**
	 * Gets a list of all Entities from the DB
	 * @param e
	 * @return
	 */
	public <T extends IEntity> List<T> getAllEntities(Class<T> e);
	
	public void deleteEntity(IEntity entity);
	
	public void updateEntity(IEntity entity);
	
	public List<Kunde> searchKunde(String field, String value);
	
	/**
	 * Gets the Kunde that matches vorname and nachname.
	 * Returns null if no match is found. If more than 1 Kunde matches.. returns the first match.
	 * @param vorname
	 * @param nachname
	 * @return
	 */
	public Kunde getKundeByName(String vorname, String nachname);
}
